package HealthCard;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.tencent.healthcard.impl.HealthCardServerImpl;
import com.tencent.healthcard.model.CommonIn;
import com.tencent.healthcard.model.HealthCardInfo;
import java.util.UUID;

public class Test_register {

    public static void main(String[] args) {
        /**
         * 接口：注册健康卡接口
         */
        //appSecret
        String appSecret="0626b6e57b68a2c65643a4ba4e0xxxxx";
        HealthCardServerImpl healthCard=new HealthCardServerImpl(appSecret);
        //构造公共输入参数commonIn
        String appToken="776cdb3a388db7d2437baeaaa2dd9146";
        String requestId= UUID.randomUUID().toString().replaceAll("-", "").toUpperCase();
        String hospitalId="20012";
        CommonIn commonIn=new CommonIn(appToken,requestId,hospitalId);
        //构造请求参数req
        String birthday="1996-01-23";
        String idType="01";
        String address="湖南省长沙市芙蓉区";
        String gender="男";
        String nation="汉族";
        String name="邓联见";
        String wechatCode="XXXXX6796D3869FF82FAE7E81E9814B7";
        String idNumber="432624195703133116";
        String phone1="1856581xxxx";
        String patid="10086";
        HealthCardInfo healthCardInfoReq=new HealthCardInfo();
        healthCardInfoReq.setAddress(address);
        healthCardInfoReq.setBirthday(birthday);
        healthCardInfoReq.setGender(gender);
        healthCardInfoReq.setIdNumber(idNumber);
        healthCardInfoReq.setIdType(idType);
        healthCardInfoReq.setNation(nation);
        healthCardInfoReq.setName(name);
        healthCardInfoReq.setPhone1(phone1);
        healthCardInfoReq.setWechatCode(wechatCode);
        healthCardInfoReq.setPatid(patid);
        //调用接口
        JSONObject healthCardInfoRsp=healthCard.registerHealthCard(commonIn,healthCardInfoReq);
        //打印响应
        System.out.println(JSON.toJSONString(healthCardInfoRsp));
    }
}